**** OPEN OUTPUT LOG FILE  *****


log using "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\OUTPUT\Performance Management.APPENDIX D MODELS.04-10-2025.smcl", replace 







*** APPENDIX D MODELS: ANALYZING SENSITIVITY OF MANUSCRIPT MODEL ESTIMATES -- OMITTING 2nd IT MODERNIZATION REFORMS [NEBRASKA AND NEW MEXICO] & 2020-2022 [COVID YEARS] ***




*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************







*** MODELS PREDICTING VARIOUS TYPE OF PROGRAM ERROR RATES BASED ON BAM SAMPLING RATES ***





*** MODEL 1: OVERALL ERROR RATE: (SAMPLE WEIGHTED) ***

*  [# overpayment errors / paid claims sample] + [# underpayment errors / paid claims sample] + [# erroneous denials / denied claims sample] + [# underpayment errors / denied claims sample] *



*** MODEL 2: ABSOLUTE TYPE I ERROR RATE ***

* [overpayment error rate / paid claims sample] *




*** MODEL 3: RELATIVE TYPE I ERROR RATE:  {TYPE I ERROR RATE /  [TYPE I ERROR RATE + TYPE II ERROR RATE]}      (SAMPLE WEIGHTED)  ***

*  {[overpayment error rate / paid claims sample]   /  [overpayment error rate / paid claims sample]   +  [underpayment error rate / paid claims sample]  +  [erroneous denial / denied claims sample]  +  [underpayment error / denied claims sample]}  *









****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** RETRIEVE MANUSCRIPT MODELS DATABASE [as of 04-10-2025] ***


use "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\DATA\Performance Management.MANUSCRIPT DATABASE.04-10-2025.dta", clear




*** SET DATA TO PANEL STRUCTURE  ***

xtset stateid monthyear, monthly

*
*
*
*



**** TABLE D1 -- MODELS D1-D3: "TASK COMPLEXITY, ORGANIZATIONAL ADAPTATION & PROGRAM ERROR RATES" APPENDIX D STATISTICAL ANALYSES [APRIL 2025]: ORGANIZATIONAL ADAPTATION EFFECTS ON PROGRAM PAYMENT ERROR RATES [TOTAL PROGRAM ERROR RATE] **** 


** (MODEL D1; FIGURES D1A-D1C; MODEL D2: FIGURES D2A-D2C; MODEL D3: FIGURES D2D-D2F) **




****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** COMPUTE CATEGORICAL TASK COMPLEXITY COVARIATE MEASURES [CONDITIONAL ADAPTATION TO IT MODERNIZATION REFORMS, EXCLUDING YEAR 2002 & 2020-2022] ***



** (1) INTERSTATE CASE RATES [PAID & DENIED CLAIMS SAMPLES: TOTAL ERROR RATE & RELATIVE TYPE I ERROR RATE [MODELS D1 & D3];  PAID CLAIMS SAMPLE ONLY: ABSOLUTE TYPE I ERROR RATE [MODEL D2] **


* Overall Program Error Rate *

quietly reg totalerror_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  if itmod_adopt_state==1 & stateid!=51 & stateid!=52 & year<2020
*
*
sum tot_interstate if e(sample), detail
di r(p75)
di r(p25)
*
gen tot_interstate_catD =.
replace tot_interstate_catD = 0 if tot_interstate<= r(p25) 
replace tot_interstate_catD = 1 if tot_interstate> r(p25) & tot_interstate < r(p75) 
replace tot_interstate_catD = 2 if tot_interstate>= r(p75) 
*
tab tot_interstate_catD if e(sample)
tab tot_interstate_catD if e(sample) & itmod_adopt_state==1
*
*
*
* Absolute Type I Error Rate *

quietly reg t1error_rat  itmod_monthcount  t1_interstate    t1_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt   if itmod_adopt_state==1 & stateid!=51 & stateid!=52 & year<2020
*
*
sum t1_interstate if e(sample), detail
di r(p75)
di r(p25)
*
gen t1_interstate_catD =.
replace t1_interstate_catD = 0 if t1_interstate<= r(p25) 
replace t1_interstate_catD = 1 if t1_interstate> r(p25) & t1_interstate < r(p75) 
replace t1_interstate_catD = 2 if t1_interstate>= r(p75) 
*
tab t1_interstate_catD if e(sample)
tab t1_interstate_catD if e(sample) & itmod_adopt_state==1
*
*
*
* Relative Type I Error Rate [same as Overall Program Error Rate since Contains Both Type I & Type II Program Error Rates] *

quietly reg relt1error_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt   adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  if itmod_adopt_state==1 & stateid!=51 & stateid!=52 & year<2020
*
*
sum tot_interstate if e(sample), detail
di r(p75)
di r(p25)
*
gen relt1_interstate_catD =.
replace relt1_interstate_catD = 0 if tot_interstate<= r(p25) 
replace relt1_interstate_catD = 1 if tot_interstate> r(p25) & tot_interstate < r(p75) 
replace relt1_interstate_catD = 2 if tot_interstate>= r(p75) 
*
tab relt1_interstate_catD if e(sample)
tab relt1_interstate_catD if e(sample) & itmod_adopt_state==1
*


***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



** (2) DIFFERENT OCCUPATION SEEKING RATE [PAID & DENIED CLAIMS SAMPLES: TOTAL ERROR RATE & RELATIVE TYPE I ERROR RATE [MODELS D1 & D3];  PAID CLAIMS SAMPLE ONLY: ABSOLUTE TYPE I ERROR RATE [MODEL D2] **



* Overall Program Error Rate *

quietly reg totalerror_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  if itmod_adopt_state==1 & stateid!=51 & stateid!=52 & year<2020
*
*
sum tot_diffoccupseek if e(sample), detail
di r(p75)
di r(p25)
*
gen tot_diffoccupseek_catD =.
replace tot_diffoccupseek_catD = 0 if tot_diffoccupseek<= r(p25) 
replace tot_diffoccupseek_catD = 1 if tot_diffoccupseek> r(p25) & tot_diffoccupseek < r(p75) 
replace tot_diffoccupseek_catD = 2 if tot_diffoccupseek>= r(p75) 
*
tab tot_diffoccupseek_catD if e(sample)
tab tot_diffoccupseek_catD if e(sample) & itmod_adopt_state==1
*
*
*


* Absolute Type I Error Rate *

quietly reg t1error_rat  itmod_monthcount  t1_interstate    t1_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt   if itmod_adopt_state==1 & stateid!=51 & stateid!=52 & year<2020
*
*
sum t1_diffoccupseek if e(sample), detail
di r(p75)
di r(p25)
*
gen t1_diffoccupseek_catD =.
replace t1_diffoccupseek_catD = 0 if t1_diffoccupseek<= r(p25) 
replace t1_diffoccupseek_catD = 1 if t1_diffoccupseek> r(p25) & t1_diffoccupseek < r(p75) 
replace t1_diffoccupseek_catD = 2 if t1_diffoccupseek>= r(p75) 
*
tab t1_diffoccupseek_catD if e(sample)
tab t1_diffoccupseek_catD if e(sample) & itmod_adopt_state==1
*
*
*

* 
* Relative Type I Error Rate [same as Overall Program Error Rate since Contains Both Type I & Type II Program Error Rates] *

quietly reg relt1error_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  if itmod_adopt_state==1 & stateid!=51 & stateid!=52 & year<2020
sum tot_diffoccupseek if e(sample), detail
di r(p75)
di r(p25)
*
gen relt1_diffoccupseek_catD =.
replace relt1_diffoccupseek_catD = 0 if tot_diffoccupseek<= r(p25) 
replace relt1_diffoccupseek_catD = 1 if tot_diffoccupseek> r(p25) & tot_diffoccupseek < r(p75) 
replace relt1_diffoccupseek_catD = 2 if tot_diffoccupseek>= r(p75) 
*
tab relt1_diffoccupseek_catD if e(sample)
tab relt1_diffoccupseek_catD if e(sample) & itmod_adopt_state==1
*
*
*


********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*


*** TESTING H1 & H3: TOTAL PROGRAM ERROR RATE ORGANIZATIONAL ADAPTATION ***




*** ESTIMATE MODEL D1: TOTAL PROGRAM ERROR  RATE [MODEL D1  with 2002-2004 & 2020-2022 YEARS OMITTED FROM ESTIMATION SAMPLE: PROPORTION OF TOTAL ERRORS VIA WEEKLY BAM SURVEY AGGREGATED TO MONTHLY OBSERVATIONS: [CONTROLS, PLUS STATE, YEAR, and ADOPTION YEAR COHORT UNIT EFFECTS] *** 	(FIGURES D1A-D1C) 


npregress series totalerror_rat  itmod_monthcount i.tot_interstate_catD   i.tot_diffoccupseek_catD if itmod_adopt_state==1 & stateid!=51 & stateid!=52 & year<2020, asis(demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat   i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt)  vce(bootstrap, seed(123) rep(1000))



** COMPUTE PSEUDO R^2 [SSE / (SSE + SSR) = EXPLAINED/PREDICTED SUM OF SQUARES / (EXPLAINED/PREDICTED SUM OF SQUARES + RESIDUAL SUM OF SQUARES)] = SSE / SST

predict predsy_m1d if e(sample)
predict residsy_m1d if e(sample), residuals

gen sse_m1d = predsy_m1d * predsy_m1d if e(sample)
gen ssr_m1d = residsy_m1d * residsy_m1d if e(sample)

egen sum_sse_m1d = total(sse_m1d) if e(sample)
egen sum_ssr_m1d = total(ssr_m1d) if e(sample)

gen r2_m1d = sum_ssr_m1d/(sum_sse_m1d + sum_ssr_m1d)

sum r2_m1d

*
*
*

* [MODEL D1: TOTAL PROGRAM ERROR RATE] FIGURE D1A:  UNCONDITIONAL ADAPTATION EFFECTS -- E(Y) [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]

margins, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) ///
legend(on order(1 "Unconditional Adaptation") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE D1A}""{bf:Unconditional Adaptation Effect}" "{bf:(Total Program Error Rate [MODEL D1])}", size(10pt) linegap(0.7) margin(t+1 b+2 r-6)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Total Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model D1.FIGURE D1A.04-10-2025.gph", replace
*
*
*
*
* [MODEL D1: TOTAL PROGRAM ERROR RATE] FIGURE D1B:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (tot_interstate_catD==2) & LOW COMPLEXITY (tot_interstate_catD==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.tot_interstate_catD if tot_interstate_catD==0|tot_interstate_catD==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))


marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE D1B}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Interstate Claims: Total Program Error Rate [MODEL D1])}", size(10pt) linegap(0.7) margin(t+1 b+2 r-10)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Total Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model D1.FIGURE D1B.04-10-2025.gph", replace
*
*
*
* [MODEL D1: TOTAL PROGRAM ERROR RATE] FIGURE D1C:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (tot_diffoccupseek_catD==2) & LOW COMPLEXITY (tot_extbenefits_catD==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***
margins r.tot_diffoccupseek_catD if tot_diffoccupseek_catD==0|tot_diffoccupseek_catD==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE D1C}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Seeking Different Occupation: Total Program Error Rate [MODEL D1])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-10)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Total Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model D1.FIGURE D1C.04-10-2025.gph", replace
*


****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** TESTING H2 & H4: ABSOLUTE TYPE I ERROR RATE ORGANZATIONAL ADAPTATION  ***



*** ESTIMATE MODEL D2: ABSOLUTE TYPE I ERROR RATE [MODEL 2 with 2002-2004 & 2020-2022 YEARS OMITTED FROM ESTIMATION SAMPLE: PROPORTION OF TOTAL ERRORS VIA WEEKLY BAM SURVEY AGGREGATED TO MONTHLY OBSERVATIONS: [PLUS STATE, YEAR, and ADOPTION YEAR COHORT UNIT EFFECTS] *** 	(FIGURES D2A-D2C) 


npregress series t1error_rat  itmod_monthcount  i.t1_interstate_catD   i.t1_diffoccupseek_catD if itmod_adopt_state==1 & stateid!=51 & stateid!=52 & year<2020, asis(demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate  ln_function_sup_avgsalreal  t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat   i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt)  vce(bootstrap, seed(123) rep(1000))




** COMPUTE PSEUDO R^2 [SSE / (SSE + SSR) = EXPLAINED/PREDICTED SUM OF SQUARES / (EXPLAINED/PREDICTED SUM OF SQUARES + RESIDUAL SUM OF SQUARES)] = SSE / SST

predict predsy_m2d if e(sample)
predict residsy_m2d if e(sample), residuals

gen sse_m2d = predsy_m2d * predsy_m2d if e(sample)
gen ssr_m2d = residsy_m2d * residsy_m2d if e(sample)

egen sum_sse_m2d = total(sse_m2d) if e(sample)
egen sum_ssr_m2d = total(ssr_m2d) if e(sample)

gen r2_m2d = sum_ssr_m2d/(sum_sse_m2d + sum_ssr_m2d)

sum r2_m2d

*
*
*

* [MODEL D2: ABSOLUTE TYPE I ERROR RATE] FIGURE D2A:  UNCONDITIONAL ADAPTATION EFFECTS -- E(Y) [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]

margins, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) ///
legend(on order(1 "Unconditional Adaptation") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE D2A}""{bf:Unconditional Adaptation Effect}" "{bf:(Absolute Type I Program Error Rate [MODEL D2])}", size(10pt) linegap(0.7) margin(t+1 b+2 r-10)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Absolute Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model D2.FIGURE D2A.04-10-2025.gph", replace



* [MODEL D2: ABSOLUTE TYPE I ERROR RATE] FIGURE D2B:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (t1_interstate_catD==2) & LOW COMPLEXITY (t1_interstate_catD==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.t1_interstate_catD if t1_interstate_catD==0|t1_interstate_catD==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE D2B}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Interstate Claims: Absolute Type I Program Error Rate [MODEL D2])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-10)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Absolute Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(#3, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*

graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model D2.FIGURE D2B.04-10-2025.gph", replace
*
*
*
* [MODEL D2: ABSOLUTE TYPE I ERROR RATE] FIGURE D2C:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (t1_diffoccupseek_catD==2) & LOW COMPLEXITY (t1_extbenefits_catD==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.t1_diffoccupseek_catD if t1_diffoccupseek_catD==0|t1_diffoccupseek_catD==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE D2C}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Seeking Different Occupation: Absolute Type I Program Error Rate [MODEL D2])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-10)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Absolute Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(#3, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model D2.FIGURE D2C.04-10-2025.gph", replace


****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** TESTING H2 & H4: RELATIVE TYPE I ERROR RATE [TYPE I ERROR RATE / (TYPE I ERROR RATE + TYPE II ERROR RATE)] ORGANIZATIONAL ADAPTATION ***




*** ESTIMATE MODEL D3: RELATIVE TYPE I ERROR RATE [MODEL 3 with 2002-2004 & 2020-2022 YEARS OMITTED FROM ESTIMATION SAMPLE: PROPORTION OF SAMPLE-WEIGHTED CASES OF TOTAL ERRORS VIA WEEKLY BAM SURVEY AGGREGATED TO MONTHLY OBSERVATIONS: [PLUS STATE, YEAR, and ADOPTION YEAR COHORT UNIT EFFECTS] ***  (FIGURES D2E-D2F) 


npregress series relt1error_rat  itmod_monthcount  i.relt1_interstate_catD   i.relt1_diffoccupseek_catD   if itmod_adopt_state==1 & stateid!=51 & stateid!=52 & year<2020, asis(demgovparty repgovparty ln_workload automationrate  ln_uiadmin_budget_real  benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat   i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt)  vce(bootstrap, seed(123) rep(1000))
*
*
*


** COMPUTE PSEUDO R^2 [SSE / (SSE + SSR) = EXPLAINED/PREDICTED SUM OF SQUARES / (EXPLAINED/PREDICTED SUM OF SQUARES + RESIDUAL SUM OF SQUARES)] = SSE / SST

predict predsy_m3d if e(sample)
predict residsy_m3d if e(sample), residuals

gen sse_m3d = predsy_m3d * predsy_m3d if e(sample)
gen ssr_m3d = residsy_m3d * residsy_m3d if e(sample)

egen sum_sse_m3d = total(sse_m3d) if e(sample)
egen sum_ssr_m3d = total(ssr_m3d) if e(sample)

gen r2_m3d = sum_ssr_m3d/(sum_sse_m3d + sum_ssr_m3d)

sum r2_m3d




* [MODEL D3: RELATIVE TYPE I ERROR RATE]  FIGURE D2D:  UNCONDITIONAL ADAPTATION EFFECTS -- E(Y) [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]

margins, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) ///
legend(on order(1 "Unconditional Adaptation") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE D2D}""{bf:Unconditional Adaptation Effect}" "{bf:(Relative Type I Error Rate [MODEL D3])}", size(10pt) linegap(0.7) margin(t+1 b+2 r-10)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Relative Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model D3.FIGURE D2D.04-10-2025.gph", replace

*
*
*
*
* [MODEL D3: RELATIVE TYPE I ERROR RATE] FIGURE D2E:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (relt1_interstate_catD==2) & LOW COMPLEXITY (relt1_interstate_catD==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.relt1_interstate_catD if relt1_interstate_catD==0|relt1_interstate_catD==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE D2E}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Interstate Claims: Relative Type I Program Error Rate [MODEL D3])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-10)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Relative Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model D3.FIGURE D2E.04-10-2025.gph", replace
*
*
*

* [MODEL D3: RELATIVE TYPE I ERROR RATE] FIGURE D2F:   MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (relt1_diffoccupseek_catD==2) & LOW COMPLEXITY (relt1_diffoccupseek_catD==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.relt1_diffoccupseek_catD if relt1_diffoccupseek_catD==0|relt1_diffoccupseek_catD==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE D2F}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Seeking Different Occupation: Relative Type I Program Error Rate [MODEL D3])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-10)) ///
xtitle("Months since IT Reform", size(10pt) margin(t+2 b+2)) ///
ytitle("Relative Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model D3.FIGURE D2F.04-10-2025.gph", replace



***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



log close
